const path = require('path')
const nodeExternal = require('webpack-node-externals')
const merge = require('webpack-merge')

const base = require('./webpack.base.js')

module.exports = merge(base, {
    target: 'node', // webpack 打包的目标环境。
    entry: './src/server/index.js',
    output: {
        path: path.resolve('build'),
        filename: 'server.js'
    },
    externals: [nodeExternal()]
    //负责检测所有引入的核心模块，并且告诉webpack 不要把核心模块打包到 server.js 里面去。
})
